import 'package:get/get.dart';
import '../repositories/todo_repository.dart';
import '../services/todo_service.dart';
import '../controller/home_controller.dart';
import '../../../core/network/api_client.dart';

class HomeBinding extends Bindings {
  @override
  void dependencies() {
    // 初始化网络客户端
    ApiClient().init();
    
    // 注册依赖 - 可以切换使用真实API或Mock数据
    Get.lazyPut<TodoRepository>(() => MockTodoRepository());
    // Get.lazyPut<TodoRepository>(() => ApiTodoRepository()); // 使用真实API
    
    Get.lazyPut<TodoService>(() => TodoService(Get.find()));
    Get.lazyPut<HomeController>(() => HomeController(Get.find()));
  }
}